#include "junix.h"

#define entry(p,T, m)                           \
    (T*)(((void*)p)-(int)&(((T*)0)->m))

struct A
{
    int i;
    int j;
    int k;
};

    
int main(int argc, char **argv)
{
    struct A a={5,6,7};
    int *pi = &(a.k);
    struct A *pA = entry(pi,struct A,k);
    printf("A.i:%d\n",pA->i);
    printf("A.j:%d\n",pA->j);
    printf("A.k:%d\n",pA->k);
     
    exit(0);
}

